package com.qdxwx.models.favorite;


import com.qdxwx.models.teacher.Teacher;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


public class Favorite implements Serializable{

    private static final long serialVersionUID = -8456831744306531536L;

    //主键
    private int id;

    //关联id
    private int infoId;

    //类型 参考ChannelModule
    private int typeId;

    //用户id
    private long userId;

    // 名字
    private String title;

    // 图片
    private String cover;

    //销售价格（实际支付价格）设置为0则可免费观看
    private Integer price;

    //辅助字段
    private List<Teacher> teacherList;//该课程下的老师list

    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getInfoId() {
        return infoId;
    }

    public void setInfoId(int infoId) {
        this.infoId = infoId;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public List<Teacher> getTeacherList() {
        return teacherList;
    }

    public void setTeacherList(List<Teacher> teacherList) {
        this.teacherList = teacherList;
    }

    public LocalDateTime getAddTime() {
        return addTime;
    }

    public void setAddTime(LocalDateTime addTime) {
        this.addTime = addTime;
    }

    @Override
    public String toString() {
        return "Favorite{" +
                "id=" + id +
                ", infoId=" + infoId +
                ", typeId='" + typeId + '\'' +
                ", userId=" + userId +
                ", title='" + title + '\'' +
                ", logo='" + cover + '\'' +
                ", price=" + price +
                ", teacherList=" + teacherList +
                ", addTime=" + addTime +
                '}';
    }
}
